package org.dingfugui.triple.link;

import org.dingfugui.triple.connection.Connection;
import org.dingfugui.triple.connection.ConnectionFactory;

import java.net.InetSocketAddress;

/**
 * 直连短链接
 * Created by fugui.ding on 2015/6/10.
 */
public class DirectShortLink extends AbstractLink {

    public DirectShortLink(InetSocketAddress address, ConnectionFactory factory) {
        super(address, factory);
    }

    @Override
    public Connection getConnection() {
        return factory.getConnection(address);
    }

    @Override
    public void destory(Connection con) {
        if (con != null) {
            con.close();
        }
    }

    @Override
    public void close() {

    }
}
